home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- AutoRedraw = -1 'True
- Caption = "RLBar BarCode OCX Extra Version DEMO"
- ClientHeight = 5952
- ClientLeft = 1128
- ClientTop = 756
- ClientWidth = 6696
- Height = 6336
- Left = 1080
- LinkTopic = "Form1"
- MousePointer = 2 'Cross
- ScaleHeight = 5952
- ScaleWidth = 6696
- Top = 420
- Width = 6792
- Begin VB.CommandButton Command2
- Caption = "Test Print All BarCode"
- Height = 405
- Left = 4740
- MousePointer = 1 'Arrow
- TabIndex = 9
- Top = 630
- Width = 1875
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- AutoRedraw = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 2505
- Left = 0
- MousePointer = 2 'Cross
- ScaleHeight = 2484
- ScaleWidth = 6648
- TabIndex = 6
- Top = 3450
- Width = 6675
- End
- Begin VB.CommandButton Command1
- Caption = "Output To Printer"
- Height = 525
- Left = 4740
- MousePointer = 1 'Arrow
- TabIndex = 3
- Top = 90
- Width = 1875
- End
- Begin VB.Frame Frame1
- Caption = "BarCode"
- Height = 915
- Left = 60
- TabIndex = 0
- Top = 60
- Width = 4635
- Begin VB.TextBox Text1
- Height = 285
- Left = 1620
- MousePointer = 3 'I-Beam
- TabIndex = 8
- Text = "123456789012"
- Top = 570
- Width = 2925
- End
- Begin VB.ComboBox Combo1
- Height = 315
- Left = 1620
- MousePointer = 1 'Arrow
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 210
- Width = 2955
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "Press BarCode Code"
- Height = 195
- Left = 60
- TabIndex = 7
- Top = 600
- Width = 1470
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "Select BarCode Type"
- Height = 195
- Left = 60
- TabIndex = 2
- Top = 270
- Width = 1515
- End
- End
- Begin RLBARPRO.RLBar RLBar1
- Left = 5760
- Top = 1392
- _ExtentX = 699
- _ExtentY = 699
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Click Picture1 Can Show Barcode on Picture1 that mouse position"
- Enabled = 0 'False
- Height = 195
- Left = 60
- TabIndex = 5
- Top = 3240
- Width = 4665
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Click Form1 Can Show Barcode on Form1 that mouse position"
- Enabled = 0 'False
- Height = 195
- Left = 90
- TabIndex = 4
- Top = 990
- Width = 4365
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Public Sub MakeBarDraw(pObject As Object, pX As Single, pY As Single)
- Dim tmpBarText As String
- 'Get the BarCode's Code
- tmpBarText = Text1.Text
- 'Important!! The [pObject] must can support the
- ' Drawing Method ,
- ' eg: [Cls] Method & [Line] Method
- 'Clear pObject
- pObject.Cls
- 'Draw the BarCode Type that selected of Combo1
- 'Draw in pObject
- 'CurrentX & Y is mouse location.
- 'Code is 1234567890
- 'Width is 20,Height is 500
- 'Show the Code Text Below
- 'Standard Font (No Bold, No Italic or Underline)
- 'Font Name is Arial
- 'Font Color is Blue (1), BarCode Color is Black (0)
- 'Barcode Narrow is 5:2
- 'and also show CheckSum.
- Select Case Combo1.ListIndex
- Case 0 'CODABAR (must has 2,4,6,8...etc digits)
- RLBar1.BarCODABAR pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 1 'Code 11
- RLBar1.BarCODE11 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 2 'Code128 (must Start With A,B or C)
- RLBar1.BarCODE128 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 3 'Code25
- RLBar1.BarCODE25 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 4 'Code 39
- RLBar1.BarCODE39 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 5 'Code 39 Extend Full ASCII
- RLBar1.BarCODE39F pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 6 'Code 93
- RLBar1.BarCODE93 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 7 'EAN-13 (must be 12 digits)
- RLBar1.BarEAN13 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 8 'EAN-8 (must be 7 digits)
- RLBar1.BarEAN8 pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 9 'ISBN
- RLBar1.BarISBN pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 10 'Code MSI
- RLBar1.BarMSI pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 11 'PostNet (must be 5,6,9 digits)
- RLBar1.BarPOSTNET pObject, pX, pY, tmpBarText, 20, 100, 0, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 12 'UPC-A (must be 11 digits)
- RLBar1.BarUPCA pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 13 'UPC-A Plus (must be 11 digits)
- RLBar1.BarUPCAPlus pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 14 'UPC-E (must be 6 digits)
- RLBar1.BarUPCE pObject, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- End Select
- End Sub
- Public Sub MakeBarToPrinter(pX As Single, pY As Single)
- Dim tmpBarText As String
- 'Get the BarCode's Code
- tmpBarText = Text1.Text
- '/// in here, we output to printer use set pObject to Printer Object
- 'Draw the BarCode Type that selected of Combo1
- 'Draw in printer buffer
- 'CurrentX & Y is mouse location.
- 'Code is 1234567890
- 'Width is 10,Height is 500
- 'Show the Code Text Below
- 'Standard Font (No Bold, No Italic or Underline)
- 'Font Name is Arial
- 'Font Color is Blue (1), BarCode Color is Black (0)
- 'Barcode Narrow is 3:1
- 'and also show CheckSum.
- Select Case Combo1.ListIndex
- Case 0 'CODABAR (must has 2,4,6,8...etc digits)
- RLBar1.BarCODABAR Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 1 'Code 11
- RLBar1.BarCODE11 Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 2 'Code128 (must Start With A,B or C)
- RLBar1.BarCODE128 Printer, pX, pY, tmpBarText, 20, 400, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 3 'Code25
- RLBar1.BarCODE25 Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 4 'Code 39
- RLBar1.BarCODE39 Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 5 'Code 39 Extend Full ASCII
- RLBar1.BarCODE39F Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 6 'Code 93
- RLBar1.BarCODE93 Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 7 'EAN-13 (must be 12 digits)
- RLBar1.BarEAN13 Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 8 'EAN-8 (must be 7 digits)
- RLBar1.BarEAN8 Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 9 'ISBN
- RLBar1.BarISBN Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 10 'Code MSI
- RLBar1.BarMSI Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 11 'PostNet (must be 5,6,9 digits)
- RLBar1.BarPOSTNET Printer, pX, pY, tmpBarText, 20, 500, 0, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- Case 12 'UPC-A (must be 11 digits)
- RLBar1.BarUPCA Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 13 'UPC-A Plus (must be 11 digits)
- RLBar1.BarUPCAPlus Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- Case 14 'UPC-E (must be 6 digits)
- RLBar1.BarUPCE Printer, pX, pY, tmpBarText, 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- End Select
- Printer.EndDoc
- End Sub
- Private Sub Command1_Click()
- 'When user click on Command1
- 'This Event will be active
- 'then call the function of draw BarCode to printer
- Call MakeBarToPrinter(0, 0)
- End Sub
- Private Sub Command2_Click()
- Dim tmpResult As Integer
- Dim pX As Single
- Dim pY As Single
- pX = 500
- pY = 10
- tmpStep = 1000
- 'CODABAR (must has 2,4,6,8...etc digits)
- Printer.CurrentX = 3000
- Printer.Print "CODABAR"
- RLBar1.BarCODABAR Printer, pX, pY, "A123456A", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep
- 'Code 11
- Printer.CurrentX = 3000
- Printer.Print "Code 11"
- RLBar1.BarCODE11 Printer, pX, pY, "123456", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep
- 'Code128 (must Start With A,B or C)
- Printer.CurrentX = 3000
- Printer.Print "Code 128"
- RLBar1.BarCODE128 Printer, pX, pY, "C123456", 20, 400, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- 'Code25
- Printer.CurrentX = 3000
- Printer.Print "Code 25"
- RLBar1.BarCODE25 Printer, pX, pY, "123456", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep
- 'Code 39
- Printer.CurrentX = 3000
- Printer.Print "Code 39"
- RLBar1.BarCODE39 Printer, pX, pY, "123456", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep
- 'Code 39 Extend Full ASCII
- Printer.CurrentX = 3000
- Printer.Print "Code 39 Full ASCII"
- RLBar1.BarCODE39F Printer, pX, pY, "ABC", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep
- 'Code 93
- Printer.CurrentX = 3000
- Printer.Print "Code 93"
- RLBar1.BarCODE93 Printer, pX, pY, "123456", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- 'EAN-13 (must be 12 digits)
- Printer.CurrentX = 3000
- Printer.Print "EAN-13"
- RLBar1.BarEAN13 Printer, pX, pY, "123456789012", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- 'EAN-8 (must be 7 digits)
- Printer.CurrentX = 3000
- Printer.Print "EAN-8"
- RLBar1.BarEAN8 Printer, pX, pY, "1234567", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- 'ISBN
- Printer.CurrentX = 3000
- Printer.Print "ISBN Code"
- RLBar1.BarISBN Printer, pX, pY, "123456789", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep + 500
- 'Code MSI
- Printer.CurrentX = 3000
- Printer.Print "MSI Code"
- RLBar1.BarMSI Printer, pX, pY, "123456", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep
- 'PostNet (must be 5,6,9 digits)
- Printer.CurrentX = 3000
- Printer.Print "PostNet"
- RLBar1.BarPOSTNET Printer, pX, pY, "123456789", 20, 100, 0, False, "Arial", QBColor(1), QBColor(0), "3:1", False
- pY = pY + tmpStep - 500
- 'UPC-A (must be 11 digits)
- Printer.CurrentX = 3000
- Printer.Print "UPC-A"
- RLBar1.BarUPCA Printer, pX, pY, "12345678901", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- 'UPC-A Plus (must be 11 digits)
- Printer.CurrentX = 3000
- Printer.Print "UPC-A +"
- RLBar1.BarUPCAPlus Printer, pX, pY, "12345678901", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- 'UPC-E (must be 6 digits)
- Printer.CurrentX = 3000
- Printer.Print "UPC-E"
- RLBar1.BarUPCE Printer, pX, pY, "123456", 20, 500, 1, False, "Arial", QBColor(1), QBColor(0), "3:1", True
- pY = pY + tmpStep
- Printer.EndDoc
- End Sub
- Private Sub Form_Load()
- Combo1.AddItem "Codabar"
- Combo1.AddItem "Code_11"
- Combo1.AddItem "Code_128"
- Combo1.AddItem "Code_25"
- Combo1.AddItem "Code_39"
- Combo1.AddItem "Code_39F"
- Combo1.AddItem "Code_93"
- Combo1.AddItem "EAN_13"
- Combo1.AddItem "EAN_8"
- Combo1.AddItem "ISBN"
- Combo1.AddItem "Code_MSI"
- Combo1.AddItem "PostNet"
- Combo1.AddItem "UPC_A"
- Combo1.AddItem "UPC_A_Plus"
- Combo1.AddItem "UPC_E"
- Combo1.ListIndex = 4
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'When user click on Form1
- 'This Event will be active
- 'then call the function of draw BarCode on Form1
- Call MakeBarDraw(Form1, X, Y)
- End Sub
- Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'When user click on Picture1
- 'This Event will be active
- 'then call the function of draw BarCode on Picture1
- Call MakeBarDraw(Picture1, X, Y)
- End Sub
-